<script setup>
import { channelCateService } from '@/api/channel'
import { ref } from 'vue'
// 获取分类列表
const channelList = ref([])
const getChannelList = async () => {
  const res = await channelCateService()
  channelList.value = res.data
}
getChannelList()
// 参数
const cateId = defineModel('cateId') // 显示说明
defineProps({
  channelWidth: String
})
</script>
<template>
  <div>
    <el-select
      :model-value="cateId"
      @change="cateId = $event"
      placeholder="请选择"
      :style="{ width: channelWidth || '240px' }"
    >
      <el-option
        v-for="item in channelList"
        :key="item.id"
        :label="item.cate_name"
        :value="item.id"
      />
    </el-select>
  </div>
</template>
<style lang="less" scoped></style>
